package smart.src;

import org.openswing.swing.mdi.client.InternalFrame;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import org.openswing.swing.client.EditButton;
import org.openswing.swing.client.ExportButton;
import org.openswing.swing.client.ReloadButton;
import org.openswing.swing.client.SaveButton;
import org.openswing.swing.client.InsertButton;
import org.openswing.swing.form.client.Form;

import com.j256.ormlite.support.ConnectionSource;

public class ClientDetailFrame extends InternalFrame {
	private final ClientForm clientForm = new ClientForm();
	private final JPanel panel = new JPanel();
	private final EditButton editButton = new EditButton();
	private final ExportButton exportButton = new ExportButton();
	private final ReloadButton reloadButton = new ReloadButton();
	private final SaveButton saveButton = new SaveButton();
	private final InsertButton insertButton = new InsertButton();
	
	
	
	public ClientDetailFrame(ConnectionSource connection, ClientDetailFrameController controller) {
		clientForm.setFormController(controller);
		jbInit();
		setSize(600, 500);
	}
	private void jbInit() {
		
		getContentPane().add(clientForm, BorderLayout.CENTER);
		
		getContentPane().add(panel, BorderLayout.NORTH);
		
		panel.add(insertButton);
		
		panel.add(editButton);
		
		panel.add(exportButton);
		
		panel.add(reloadButton);
		
		panel.add(saveButton);
		
		clientForm.setInsertButton(insertButton);
		clientForm.setEditButton(editButton);
		clientForm.setReloadButton(reloadButton);
		clientForm.setSaveButton(saveButton);
		
	}
	public Form getClientForm() {
		return clientForm;
	}

}
